Integrand size = 28, antiderivative size = 193 \[ \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\frac {\operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {c+d \tan (e+f x)}{c-i d}\right ) (c+d \tan (e+f x))^{1+n}}{4 a (i c+d) f (1+n)}+\frac {(i c-d+2 d n) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {c+d \tan (e+f x)}{c+i d}\right ) (c+d \tan (e+f x))^{1+n}}{4 a (c+i d)^2 f (1+n)}-\frac {(c+d \tan (e+f x))^{1+n}}{2 (i c-d) f (a+i a \tan (e+f x))} \]
1/4*hypergeom([1, 1+n],[2+n],(c+d*tan(f*x+e))/(c-I*d))*(c+d*tan(f*x+e))^(1 +n)/a/(I*c+d)/f/(1+n)+1/4*(I*c-d+2*d*n)*hypergeom([1, 1+n],[2+n],(c+d*tan( f*x+e))/(c+I*d))*(c+d*tan(f*x+e))^(1+n)/a/(c+I*d)^2/f/(1+n)-1/2*(c+d*tan(f *x+e))^(1+n)/(I*c-d)/f/(a+I*a*tan(f*x+e))
Time = 1.05 (sec) , antiderivative size = 158, normalized size of antiderivative = 0.82 \[ \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=-\frac {i (c+d \tan (e+f x))^{1+n} \left (\frac {(c+i d) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {c+d \tan (e+f x)}{c-i d}\right )}{(c-i d) (1+n)}-\frac {(c+i d (1-2 n)) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {c+d \tan (e+f x)}{c+i d}\right )}{(c+i d) (1+n)}+\frac {2 i}{-i+\tan (e+f x)}\right )}{4 a (c+i d) f} \]
((-1/4*I)*(c + d*Tan[e + f*x])^(1 + n)*(((c + I*d)*Hypergeometric2F1[1, 1 + n, 2 + n, (c + d*Tan[e + f*x])/(c - I*d)])/((c - I*d)*(1 + n)) - ((c + I *d*(1 - 2*n))*Hypergeometric2F1[1, 1 + n, 2 + n, (c + d*Tan[e + f*x])/(c + I*d)])/((c + I*d)*(1 + n)) + (2*I)/(-I + Tan[e + f*x])))/(a*(c + I*d)*f)
Time = 0.69 (sec) , antiderivative size = 222, normalized size of antiderivative = 1.15, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4035, 3042, 4022, 3042, 4020, 25, 78}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)}dx\) |
\(\Big \downarrow \) 4035 |
\(\displaystyle \frac {\int (c+d \tan (e+f x))^n (a (i c-d (1-n))-i a d n \tan (e+f x))dx}{2 a^2 (-d+i c)}-\frac {(c+d \tan (e+f x))^{n+1}}{2 f (-d+i c) (a+i a \tan (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (c+d \tan (e+f x))^n (a (i c-d (1-n))-i a d n \tan (e+f x))dx}{2 a^2 (-d+i c)}-\frac {(c+d \tan (e+f x))^{n+1}}{2 f (-d+i c) (a+i a \tan (e+f x))}\) |
\(\Big \downarrow \) 4022 |
\(\displaystyle \frac {\frac {1}{2} a (-d (1-2 n)+i c) \int (1-i \tan (e+f x)) (c+d \tan (e+f x))^ndx+\frac {1}{2} a (-d+i c) \int (i \tan (e+f x)+1) (c+d \tan (e+f x))^ndx}{2 a^2 (-d+i c)}-\frac {(c+d \tan (e+f x))^{n+1}}{2 f (-d+i c) (a+i a \tan (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {1}{2} a (-d (1-2 n)+i c) \int (1-i \tan (e+f x)) (c+d \tan (e+f x))^ndx+\frac {1}{2} a (-d+i c) \int (i \tan (e+f x)+1) (c+d \tan (e+f x))^ndx}{2 a^2 (-d+i c)}-\frac {(c+d \tan (e+f x))^{n+1}}{2 f (-d+i c) (a+i a \tan (e+f x))}\) |
\(\Big \downarrow \) 4020 |
\(\displaystyle \frac {\frac {i a (-d+i c) \int -\frac {(c+d \tan (e+f x))^n}{1-i \tan (e+f x)}d(i \tan (e+f x))}{2 f}-\frac {i a (-d (1-2 n)+i c) \int -\frac {(c+d \tan (e+f x))^n}{i \tan (e+f x)+1}d(-i \tan (e+f x))}{2 f}}{2 a^2 (-d+i c)}-\frac {(c+d \tan (e+f x))^{n+1}}{2 f (-d+i c) (a+i a \tan (e+f x))}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\frac {i a (-d (1-2 n)+i c) \int \frac {(c+d \tan (e+f x))^n}{i \tan (e+f x)+1}d(-i \tan (e+f x))}{2 f}-\frac {i a (-d+i c) \int \frac {(c+d \tan (e+f x))^n}{1-i \tan (e+f x)}d(i \tan (e+f x))}{2 f}}{2 a^2 (-d+i c)}-\frac {(c+d \tan (e+f x))^{n+1}}{2 f (-d+i c) (a+i a \tan (e+f x))}\) |
\(\Big \downarrow \) 78 |
\(\displaystyle \frac {\frac {i a (-d (1-2 n)+i c) (c+d \tan (e+f x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {c+d \tan (e+f x)}{c+i d}\right )}{2 f (n+1) (c+i d)}-\frac {i a (-d+i c) (c+d \tan (e+f x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {c+d \tan (e+f x)}{c-i d}\right )}{2 f (n+1) (c-i d)}}{2 a^2 (-d+i c)}-\frac {(c+d \tan (e+f x))^{n+1}}{2 f (-d+i c) (a+i a \tan (e+f x))}\) |
-1/2*(c + d*Tan[e + f*x])^(1 + n)/((I*c - d)*f*(a + I*a*Tan[e + f*x])) + ( ((-1/2*I)*a*(I*c - d)*Hypergeometric2F1[1, 1 + n, 2 + n, (c + d*Tan[e + f* x])/(c - I*d)]*(c + d*Tan[e + f*x])^(1 + n))/((c - I*d)*f*(1 + n)) + ((I/2 )*a*(I*c - d*(1 - 2*n))*Hypergeometric2F1[1, 1 + n, 2 + n, (c + d*Tan[e + f*x])/(c + I*d)]*(c + d*Tan[e + f*x])^(1 + n))/((c + I*d)*f*(1 + n)))/(2*a ^2*(I*c - d))
3.12.77.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b *c - a*d)^n*((a + b*x)^(m + 1)/(b^(n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m}, x] && !IntegerQ[m] && IntegerQ[n]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[c*(d/f) Subst[Int[(a + (b/d)*x)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[ b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c + I*d)/2 Int[(a + b*Tan[e + f*x])^m*( 1 - I*Tan[e + f*x]), x], x] + Simp[(c - I*d)/2 Int[(a + b*Tan[e + f*x])^m *(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && !IntegerQ[m]
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-a)*((c + d*Tan[e + f*x])^(n + 1)/(2*f*(b* c - a*d)*(a + b*Tan[e + f*x]))), x] + Simp[1/(2*a*(b*c - a*d)) Int[(c + d *Tan[e + f*x])^n*Simp[b*c + a*d*(n - 1) - b*d*n*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && !GtQ[n, 0]
\[\int \frac {\left (c +d \tan \left (f x +e \right )\right )^{n}}{a +i a \tan \left (f x +e \right )}d x\]
\[ \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\int { \frac {{\left (d \tan \left (f x + e\right ) + c\right )}^{n}}{i \, a \tan \left (f x + e\right ) + a} \,d x } \]
integral(1/2*(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I* e) + 1))^n*(e^(2*I*f*x + 2*I*e) + 1)*e^(-2*I*f*x - 2*I*e)/a, x)
\[ \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=- \frac {i \int \frac {\left (c + d \tan {\left (e + f x \right )}\right )^{n}}{\tan {\left (e + f x \right )} - i}\, dx}{a} \]
Exception generated. \[ \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\text {Exception raised: RuntimeError} \]
\[ \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\int { \frac {{\left (d \tan \left (f x + e\right ) + c\right )}^{n}}{i \, a \tan \left (f x + e\right ) + a} \,d x } \]
Timed out. \[ \int \frac {(c+d \tan (e+f x))^n}{a+i a \tan (e+f x)} \, dx=\int \frac {{\left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n}{a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}} \,d x \]